package com.lyh.common.enums;

/**
 * Created By lgm on 15:46 2023/4/28
 */
public enum TimeIntervalEnum {

    TWO_DAY(2, "两天场"),
    THREE_DAY(3, "三天场"),
    FIVE_DAY(5, "五天场"),
    SEVEN_DAY(7, "七天场");

    Integer code;

    String name;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    TimeIntervalEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static TimeIntervalEnum getEnum(Integer code) {
        for (TimeIntervalEnum el : TimeIntervalEnum.values()) {
            if (el.getCode().equals(code)) {
                return el;
            }
        }
        return null;
    }
}
